package com.dhemery.mack.adapters.tests;

import static org.junit.Assert.*;

import org.junit.Test;

import com.dhemery.mack.adapters.FolderInformationProvider;
import com.dhemery.mack.model.Folder;
import com.dhemery.mack.model.Node;

public class FolderInformationProviderTests {

	@Test
	public void childrenAreTheSameAsFolderNodes() {
		Folder folder = new Folder();
		folder.addNode(new Node(null));
		folder.addNode(new Node(null));
		folder.addNode(new Node(null));
		FolderInformationProvider provider = new FolderInformationProvider(null);

		Object[] retrievedChildren = provider.getChildren(folder);

		assertEquals(folder.getNodes().size(), retrievedChildren.length);
		assertSame(folder.getNodes().get(0), retrievedChildren[0]);
		assertSame(folder.getNodes().get(1), retrievedChildren[1]);
		assertSame(folder.getNodes().get(2), retrievedChildren[2]);
	}
}
